A distant measurement method is conventionally known, in which disparity for an object is derived from a stereo camera by stereo imaging and a disparity value indicating this disparity is used to measure the distance from the stereo camera to the object based on the principle of triangulation. With this distance measurement method, for example, the distance between automobiles or the distance between an automobile and an obstacle is measured to be utilized for preventing automobile collisions.
A stereo matching process is used for obtaining a disparity value. In this stereo matching process, a disparity value between a reference image obtained by one of two cameras of a stereo camera and a comparison image obtained by the other camera is calculated by obtaining the position of a corresponding pixel where image signals are most similar, while successively shifting a plurality of candidates for the corresponding pixel in the comparison image relative to a reference pixel of interest in the reference image. In general, the luminance values of the image signals obtained by two cameras are compared whereby the position of the pixel with the lowest one of costs (here, cost is “dissimilarity”) in terms of luminance value compared among shift amounts is obtained (see Japanese Patent Application Laid-open No. 2006-090896).
However, in a region where texture indicating the magnitude of a luminance change of an object is weak and in which features to be extracted are scarce, a sufficient effect cannot be obtained even by performing edge detection.
A method of deriving more accurate disparity even for an object with weak texture is proposed (see, for example, Japanese Patent Application Laid-open No. 2012-181142). With this method, not only the cost of a reference pixel of interest in a reference image but also the costs of other pixels existing near to far positions from the reference pixel are aggregated to derive disparity for an object with weak texture.
However, when the distance between automobiles or other distance is measured using the method described in Japanese Patent Application Laid-open No. 2012-181142, costs for a road or other objects with weak texture are affected by costs for the surroundings with strong texture such as the vehicle running ahead. This causes failure to derive accurate costs.